package com.haizhi.crm.sys.configure.model;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * Created by caochao on 2018/05/31.
 */
@ApiModel(value = "自定义模块的vo" )
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ModuleVo {

    @ApiModelProperty("模块ID" )
    private Long moduleId;
    @ApiModelProperty("模块code" )
    private String name;
    @ApiModelProperty("模块描述" )
    private String remark;
    @ApiModelProperty("是否已添加过" )
    private boolean checked;

    public static ModuleVo fromDo(ModuleDo moduleDo) {
        return ModuleVo.builder().moduleId(moduleDo.getId()).name(moduleDo.getName()).remark(moduleDo.getRemark()).build();
    }
}
